home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / fontutil.6 / fontutil / fontutils-0.6 / charspace / input-cmi.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-13  |  1.6 KB  |  61 lines

  1. /* input-cmi.c: routines to control the CMI parsing.
  2.  
  3. Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #include "config.h"
  20.  
  21. #include "libfile.h"
  22.  
  23. #include "input-cmi.h"
  24.  
  25.  
  26. /* Font-specific sidebearing and other information.  (-cmi-files)
  27.    `cmi_file' is used as the input file in `cmi.y'.  */
  28. FILE *cmi_file;
  29. string *cmi_names = NULL;
  30.  
  31. /* Call `read_cmi_file' on each CMI file in CMI_NAMES.  DPI is
  32.    simply passed along.  */
  33.  
  34. void
  35. read_cmi_file_list (string *cmi_names, string dpi)
  36. {
  37.   if (cmi_names == NULL)
  38.     return;
  39.  
  40.   for ( ; *cmi_names != NULL; cmi_names++)
  41.     {
  42.       read_cmi_file (*cmi_names, dpi);
  43.     }
  44. }
  45.  
  46.  
  47. /* Read the CMI file `NAME.DPIcmi', unless NAME has a suffix, in which
  48.    case don't append the `.DPIcmi'.  This uses the global `cmi_file' to
  49.    communicate with the Bison parser.  */
  50.  
  51. void
  52. read_cmi_file (string name, string dpi)
  53. {
  54.   extern int yyparse ();
  55.  
  56.   cmi_file = libfile_start (name, concat (dpi, "cmi"));
  57.   yyparse ();
  58.  
  59.   libfile_close ();
  60. }
  61.